package com.shop.vuedemo.test;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.annotation.Configuration;

/**
 * projectName: vueDemo
 * create on 2021/11/21 0:32
 *
 * @author yanbl
 * @Description :
 */
@Configuration
public class BeforeRunningSpringBootThree implements BeanPostProcessor {

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("postProcessBeforeInitialization"+"\nbean:"+bean+"\nbeanHashCode:"+bean.hashCode()+"\nname:"+beanName);

        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("postProcessAfterInitialization"+"\nbean:"+bean+"\nbeanHashCode:"+bean.hashCode()+"\nname:"+beanName);
        return bean;
    }
}
